﻿@using System.ComponentModel
@model Pro260Website.Areas.Admin.Models.UserSecurityViewModel

    @using(Html.BeginForm("SaveChangesToUser", "Account", new { Area = "Admin"} , FormMethod.Post))
    {
        @Html.HiddenFor(x => @Model.Username)

        var list = new List<SelectListItem>();
        foreach(string r in Roles.GetAllRoles())
        {
            list.Add(new SelectListItem { Selected = @Model.Role.Equals(r), Text = r, Value = r });
        }                                        
                                                
        
        @Html.DropDownListFor(x => x.Role, list)<br/>
        @Html.Label("Is Banned")
        @Html.CheckBoxFor( x => x.IsBanned)<br/>
        <input class="actionButtons @Html.GetColor(Request.Cookies["color"])" type="submit" value="Save"/>
    }

    @using (Html.BeginForm("DeleteUser", "Account", new { Area = "Admin" }, FormMethod.Post))
    {
        @Html.HiddenFor(x => @Model.Username)
       <input class="actionButtons @Html.GetColor(Request.Cookies["color"])" type="submit" value="Delete"/> 
    }